The present invention relates to digital image processing and, more particularly, to a method of enhancing the contrast of a digital image by manipulating a histogram of pixel luma values.
Contrast enhancement based on histogram equalization is a standard technique in image processing. Unlike local techniques such as filtering that change a pixel value with reference only to the values of neighboring pixels, contrast enhancement is a global method that changes pixel values based on the histogram of the entire image. Contrast enhancement therefore has a significant impact on the overall appearance of an image. Contrast enhancement emphasizes weak details and can “illuminate” image regions that initially are dim.
There are two challenges in the contrast enhancement of video signals: avoiding noise amplification and enhancing the contrast of the images in real time.
With respect to noise amplification, just as signal details of the image are emphasized by contrast enhancement, so, too, noise is amplified by contrast enhancement. Special care must be taken to minimize such artifacts in noisy video signals.
With respect to real time contrast enhancement, contrast enhancement methods correct the pixel values of a video frame only after the complete histogram of the frame has been computed. Therefore, real-time contrast enhancement requires one or another form of delay. Usually, either the correction computed for each frame is applied to a subsequent frame or each frame is delayed long enough to have its own correction applied.
Contrast enhancement techniques are described in basic textbooks on image processing, for example A. K. Jain, Fundamentals of Digital Image Processing (Prentice-Hall, 1988). The standard prior art histogram equalization technique is performed as follows:
1. Compute the image histogram H(g): the number of pixels with the gray level g, where g is an integer in the interval [0,N].
2. Compute the cumulative histogram
      F    ⁡          (      g      )        =                              ∑                      k            =            0                    g                ⁢                  H          ⁡                      (            g            )                                                ∑                      k            =            0                    N                ⁢                  H          ⁡                      (            g            )                                .  Denote by Fmin the smallest positive value obtained in the cumulative histogram, i.e., the first non-zero H(g) divided by the sum of all the H(g).
3. Transform the pixels whose gray value is g to an “equalized” new resolution [0, . . . , L] according to
      P    ⁡          (      g      )        =            ⌊                                    (                                                            F                  ⁡                                      (                    g                    )                                                  -                                  F                  min                                                            1                -                                  F                  min                                                      )                    ⁢          L                +        0.5            ⌋        .  To produce an image with an enhanced contrast, the value L=N is used. For dynamic range reduction (data quantization) purposes, values of L that are less than N are used.
Applying this standard method or similar techniques to the frames of a video sequence may result in temporal discontinuities and may exhibit unstable performances on different types of scenes, such as outdoor scenes vs. indoor scenes. Therefore, the standard techniques must be modified for use with video image streams with their additional dimension of time. In addition, the method should be robust, should perform well on a wide class of typical video sequences, and should have sufficiently low complexity to be implemented in real time. Prior art patents that have addressed this and related problems include:
Opittek et al., U.S. Pat. No. 3,979,555
Ketcham et al., U.S. Pat. No. 3,983,320
Fitch et al., U.S. Pat. No. 4,231,065
Bailey et al., U.S. Pat. No. 4,353,092
Ackermann, U.S. Pat. No. 4,450,482
FitzHenry et al., U.S. Pat. No. 5,063,607
Fujimura et al., U.S. Pat. No. 5,808,697
Bhaskar, U.S. Pat. No. 6,393,148
Bhaskar, U.S. Pat. No. 6,580,825
Choi, U.S. Pat. No. 6,771,320
Stessen, U.S. Pat. No. 6,781,636
Huniu, US Published Patent Application No. 2003/0007689
Kim, US Published Patent Application No. 2003/0025838
Young et al. US Published Patent Application No. 2003/0091222
Srinivasa, US Published Patent Application No. 2004/0042676